﻿<!DOCTYPE html>
<html>
<head>
<%
    include("/static/include/title.html"){}
    include("/static/include/css.html"){}
    include("/static/include/js.html"){}
%>
</head>

<body>
<div class="layui-fluid">
	<form id="fAdd" class="layui-form" action="#" onsubmit="return false" method="post">
		<input type="hidden" id="dialogId" name="dialogId" value="${parameter.dialogId}"/>

		<div class="layui-card">
			<!-- 如需要header信息，放开下面的comment -->
			<!-- <div class="layui-card-header">基础信息</div> -->
			<div class="layui-card-body" style="padding: 15px;">
				<!-- 如一行显示多列数据，参照下面的示例 -->
				<!-- 
				<div class="layui-form-item">
					<div class="layui-inline">
						<label class="layui-form-label">属性1：</label>
						<div class="layui-input-inline">
							<input type="text" autocomplete="off" class="layui-input" maxlength="25" title="属性1对应控件">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">属性2：</label>
						<div class="layui-input-inline">
							<input type="text" autocomplete="off" class="layui-input" maxlength="25" title="属性1对应控件">
						</div>
					</div>
				</div>
				-->

				<div class="layui-form-item">
					<label class="layui-form-label">商户名称<span style="color:#FF5722;">*</span>：</label>
					<div class="layui-input-block">
						<input type="text" name="partner.partnerName" placeholder="商户名称" value="${@team.bangbang.common.utility.LogicUtility.getQuotedString(partner.partnerName)}" autocomplete="off" class="layui-input" maxlength="100">
					</div>
				</div>
	  
				<div class="layui-form-item">
					<div class="layui-inline">
						<label class="layui-form-label">联系人：</label>
						<div class="layui-input-inline">
							<input type="text" name="partner.contactPerson" placeholder="联系人" value="${@team.bangbang.common.utility.LogicUtility.getQuotedString(partner.contactPerson)}" autocomplete="off" class="layui-input" maxlength="25">
						</div>
					</div>
	  
					<div class="layui-inline">
						<label class="layui-form-label">联系电话：</label>
						<div class="layui-input-inline">
							<input type="text" name="partner.phone" placeholder="联系电话" value="${@team.bangbang.common.utility.LogicUtility.getQuotedString(partner.phone)}" autocomplete="off" class="layui-input" maxlength="25">
						</div>
					</div>
				</div>
	  
				<div class="layui-form-item">
					<div class="layui-inline">
						<label class="layui-form-label">电子信箱<span style="color:#FF5722;">*</span>：</label>
						<div class="layui-input-inline">
							<input type="email" name="partner.email" placeholder="电子信箱" value="${@team.bangbang.common.utility.LogicUtility.getQuotedString(partner.email)}" autocomplete="off" class="layui-input" maxlength="50">
						</div>
					</div>

					<div class="layui-inline">
						<label class="layui-form-label">是否有效<span style="color:#FF5722;">*</span>：</label>
						<div class="layui-input-inline">
							<input type="radio" name="partner.activeFlag" value="true" title="有效"<% if(partner.activeFlag != null && partner.activeFlag) {%> checked<%}%>/>
							<input type="radio" name="partner.activeFlag" value="false" title="禁用"<% if(partner.activeFlag == null || !partner.activeFlag) {%> checked<%}%>/>
						</div>
					</div>
				</div>

			</div>
		</div>
		
		<div class="layui-form-item layui-layout-admin">
			<div class="layui-input-block">
				<div class="layui-footer" style="left: 0;">
					<button class="layui-btn" onclick="doAddAction('partner');">新 增</button>
				</div>
			</div>
		</div>
	</form>
</div>
<script>
	layui.use(['form','laydate'], function(){
        var form  = layui.form;
        var laydate = layui.laydate;
        
        // 渲染表单radio、select、checkbox
        form.render();

		// 创建时间
		laydate.render({
			elem: '#createTime',
			format: 'yyyy-MM-dd'
		});

    });

	function validate(theForm) {
		// 注意：
		// 如果更改页面表单的控件类型，请在校验判断时做对应修改：
		// 1. 下拉框：使用 $.trim(theForm["控件名称"].value) == ""
		// 2. 单选框/复选框：使用 getChoiceValue("控件名称") == null
		// 
	
		if($.trim(theForm["partner.partnerName"].value) == "") {
			$.message("商户名称不能为空！");
			return false;
		}
	
		if($.trim(theForm["partner.email"].value) == "") {
			$.message("电子信箱不能为空！");
			return false;
		}
	
		if(getChoiceValue("partner.activeFlag") == null) {
			$.message("请选择是否有效！");
			return false;
		}
	
		return true;
	}
</script>
</body>
</html>
